package algorithmTopics.designPatterns.builderPattern;

import java.util.ArrayList;
import java.util.List;

/**
 * 餐食
 *
 * @author 86155
 * @date 2025/07/20
 */
public class Meal {
    private List<Item> items = new ArrayList<>();

    public void addItem(Item item) {
        items.add(item);
    }

    public double getCost() {
        double cost = 0;
        for (Item o : items) {
            cost+=o.price();
        }
        return cost;
    }
}
